<template>
  <div>
    <h2>商品的数量为 {{ count }}</h2>
    <button @click="btn1">+1</button>
    <button v-on:click="btn2">-1</button>
    <button @click="btn3">+5</button>
    <button @click="btn4">+10</button>
    <button v-on:click="btn5">+20</button>
  </div>
</template>

<script>
export default {
  data() {
    return {
      count: 5,
    };
  },
  methods: {
    btn1() {
      this.count++;
    },
    btn2() {
      this.count--;
    },
    btn3() {
      this.count = this.count + 5;
    },
    btn4() {
      this.count = this.count + 10;
    },
    btn5() {
      this.count = this.count + 20;
    },
  },
};
</script>

<style>
</style>